The present invention relates to a peripheral device connectable to a computer. More particularly, the present invention relates to a peripheral device configured to detect the type of interface to which it is connected.
A wide variety of peripheral devices are currently configured to be connectable to computers. Such peripheral devices commonly include user input devices, such as keyboards, point and click devices (traditionally referred to as a computer mouse) and other similar types of devices.
The computer to which such devices are connected communicates with the devices through one of a number of interfaces. Interfaces commonly used to connect to such peripheral devices include a serial interface (such as an RS232 interface) and a PS2 interface. Indeed, the PS2 interface has long been a standard for connecting keyboards and mice to computers.
However, recently, another serial interface referred to as a universal serial bus (USB) interface has been introduced. The USB interface accommodates a wide variety of computer peripherals, including, for example, keyboards and mice. However, a conventional computer is typically provided with only one interface (such as a PS2 or USB interface) for communication with peripheral devices. Therefore, if the computer is provided with a PS2 interface, the keyboard or mouse must be configured to support communication with the computer according to a protocol defined by the PS2 interface. Similarly, if the computer is provided with the USB interface, the keyboard or mouse must be configured to communicate according to a protocol defined by the USB interface.
In order to do this, a conventional computer peripheral device contains a microprocessor which runs a software program to carry out the functions of that particular peripheral device. In the device such as a keyboard or mouse, the software program includes an interface between the peripheral device and the host computer, through which the peripheral device communicates with the host computer. Such communication often includes receiving commands from the host computer and transmitting data and status information to the host computer.
As discussed above, the PS2 and USB interfaces have different hardware and software requirements, which must be met by the microprocessor in the peripheral device so that the peripheral device can communicate with the host computer. The PS2 interface uses two conductors which include a separate clock conductor and a separate data conductor. These conductors are driven by the computer through an open-collector or open-drain circuit, and have a pull-up resistor (typically in the range of 2 k ohms to 10 k ohms) pulling the conductor to a rail voltage (such as VCC) inside the host computer. The open-collector or open-drain circuit (commonly a transistor) is typically implemented inside the microprocessor. Another pull-up resistor is required inside the peripheral device as well. The peripheral device communicating over a PS2 interface is responsible for providing a clock signal on the clock conductor, regardless of the direction of data flow on the data conductor. The host computer pulls the clock conductor to a logic low level to inhibit communication from the peripheral device, and it can also pull the data conductor low to signal to the peripheral device that the host computer intends to transmit data to the peripheral device.
The USB interface also uses two conductors which include differential data signal conductors D+ and Dxe2x88x92.
In the USB interface at the USB port (i.e., at the host computer or USB hub), the two conductors are pulled to a logic low level via 15 k ohm resistors. In the peripheral device, the D+ conductor is pulled to approximately 3.3 volts via a 1.5 k ohm resistor if the peripheral device is a high-speed USB peripheral device. The Dxe2x88x92 conductor is pulled to 3.3 volts via a 1.5 k ohm resistor if the peripheral device is a low-speed USB peripheral device. When a peripheral device is attached to the USB port, the USB host determines whether it is a low-speed or high-speed device by determining which of the D+ or Dxe2x88x92 conductors is pulled to the logical high level.
Thus, it can be seen that the two interfaces have different hardware structures, and communicate using different software protocols. Traditionally, separate peripheral devices have been provided, one being configured to communicate with a USB interface, and the other being configured to communicate with a PS2 interface. This requires the manufacturer of such peripheral devices to offer two different types of peripheral devices in order to support these two different interfaces.
The present invention defines a method and apparatus in the peripheral device such that the peripheral device can determine which type of interface it is connected to, and configure itself accordingly.
The peripheral device is connectable to a computer having one of a first interface and a second interface. The first interface communicates with a peripheral device over a differential data connection having a first data conductor and a second data conductor. The second interface communicates with the peripheral device over a clock conductor and a single-ended data connection, which includes a data conductor. The peripheral device has first and second communication conductors configured for connection to the first and second data conductors in the differential data connection and to the first data conductor in the single ended data connection and the clock conductor. The peripheral device includes an interface detection component configured to detect which of the first and second interfaces the peripheral device is connected to. The peripheral device also includes a controller component configured to communicate between the peripheral device and the computer according to a protocol corresponding to the detected interface.